#######################################################
# File Name:git_install.sh
# Create Time:2018年08月26日
# Author:Mikel Pan
# email:plyx_46204@126.com
# ====================================================
#!/bin/bash
# install git
yum install -y git

# create ssh-key
ssh-keygen -t rsa -c "plyx_46204@126.com" #需要将公钥添加到gitee或者github公钥管理中

# add git configuration information
git config --global user.name "mikel"
git config --global user.email "plyx_46204@126.com"

# add localhost project
mkdir /root/scripts && cd /root/scripts #创建一个项目
git init   #初始化
touch README 
git add README   #更新README文件
git commit -m "fitst commit"
git remote add origin git@gitee.com:YunFeiGuoJi/script.git #关联远程项目
git push -u origin master #本地更新到gitree项目上

# git Project submission
cd /root/scripts
git add git_install.sh
git commit -m "git_install"
git push origin master

# git Associating different warehouses
git remote rm origin
git remote add github git@github.com:mikel/script.git
git remote add gitee git@gitee.com:YunFeiGuoJi/script.git
git push -u github master   #第一次推送加-u
git push -u gitee master    #第一次推送加-u
git push github master
git pus gitee master


